From 41ea7f0092f4fe72f9536c9424c597096d303f22 Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild.aw" Date: Wed, 9 Aug 2006 09:59:52 -0600 Subject: [PATCH] [IA64] catch up new hypercall HYPERVISR_hvm_op for IPF append HYPERVISOR_hvm_op for IPF Signed-off-by: Tsunehisa Doi Signed-off-by: Tomonari Horikoshi --- xen/arch/ia64/vmx/vmx_hypercall.c | 48 ++++++++++++++++++++++++++++- xen/arch/ia64/xen/hypercall.c | 2 +- xen/include/asm-ia64/vmx_platform.h | 2 ++ 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/xen/arch/ia64/vmx/vmx_hypercall.c b/xen/arch/ia64/vmx/vmx_hypercall.c index fc3c1d454d..3d34babe15 100644 --- a/xen/arch/ia64/vmx/vmx_hypercall.c +++ b/xen/arch/ia64/vmx/vmx_hypercall.c @@ -35,4 +35,50 @@ #include #include -/* This file will include the hypercall code for VT-i domain, soon. */ +long +do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg) +{ + long rc = 0; + + switch (op) { + case HVMOP_set_param: + case HVMOP_get_param: + { + struct xen_hvm_param a; + struct domain *d; + + if (copy_from_guest(&a, arg, 1)) + return -EFAULT; + + if (a.index > HVM_NR_PARAMS) + return -EINVAL; + + if (a.domid == DOMID_SELF) { + get_knownalive_domain(current->domain); + d = current->domain; + } + else if (IS_PRIV(current->domain)) { + d = find_domain_by_id(a.domid); + if (!d) + return -ESRCH; + } + else + return -EPERM; + + if (op == HVMOP_set_param) { + rc = 0; + d->arch.hvm_domain.params[a.index] = a.value; + } + else + rc = d->arch.hvm_domain.params[a.index]; + + put_domain(d); + return rc; + } + + default: + DPRINTK("Bad HVM op %ld.\n", op); + rc = -ENOSYS; + } + return rc; +} diff --git a/xen/arch/ia64/xen/hypercall.c b/xen/arch/ia64/xen/hypercall.c index 96d8d8f079..97924b8776 100644 --- a/xen/arch/ia64/xen/hypercall.c +++ b/xen/arch/ia64/xen/hypercall.c @@ -70,7 +70,7 @@ hypercall_t ia64_hypercall_table[] = (hypercall_t)do_ni_hypercall, /* */ (hypercall_t)do_event_channel_op, (hypercall_t)do_physdev_op, - (hypercall_t)do_ni_hypercall, /* */ + (hypercall_t)do_hvm_op, /* */ (hypercall_t)do_ni_hypercall, /* */ /* 35 */ (hypercall_t)do_ni_hypercall, /* */ (hypercall_t)do_ni_hypercall, /* */ diff --git a/xen/include/asm-ia64/vmx_platform.h b/xen/include/asm-ia64/vmx_platform.h index e5888e5e22..f73e1b0cfb 100644 --- a/xen/include/asm-ia64/vmx_platform.h +++ b/xen/include/asm-ia64/vmx_platform.h @@ -20,6 +20,7 @@ #define __ASM_IA64_VMX_PLATFORM_H__ #include +#include #include #include struct mmio_list; @@ -27,6 +28,7 @@ typedef struct virtual_platform_def { unsigned long shared_page_va; unsigned long pib_base; unsigned char xtp; + unsigned long params[HVM_NR_PARAMS]; struct mmio_list *mmio; /* One IOSAPIC now... */ struct hvm_vioapic vioapic; -- 2.30.2